#include <stdio.h>

/*
    单链表静态存储分配版
*/
struct s_list{
    int data;
    struct s_list *next;//指向struct s_list结构类型变量的指针
} node1 = {1,NULL};

int main(void)
{
    struct s_list node2,node3;
    struct s_list *head = NULL;//初始化头结点
    struct s_list *p;//声明遍历节点

    node2.data = 2;//给node2节点赋值
    node3.data = 3;//给node3节点赋值

    head = &node1;//头结点指向node1
    node1.next = &node2;//node1指向node2
    node2.next = &node3;//node2指向node3

    p = head;//遍历指针指向node1
    printf("%p\t%p\n", &head, head);

    while(p){
        printf("%p\t%d\t%p\n", p, p->data, p->next);
        p=p->next;//*遍历指针指向下一个自引用类型！！！！
    }
}